<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.7.1.js"></script>
    <link href="../../style/authority/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="../../style/authority/common_style.css" rel="stylesheet" type="text/css">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
    <link href="../../css/bootstrap.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap.js"></script>
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap-table.js"></script>
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap-table-zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="../../style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
    <script type="text/javascript" src="../../scripts/artDialog/artDialog.js?skin=default"></script>
    <title>个人信息管理系统</title>
    <script type="text/javascript">
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
            if (r != null) return unescape(r[2]);
            return null;
        }

        var type = GetQueryString("type");

        function AllInformation() {
            $.ajaxSettings.async = false;
            var countnum = 0;
            $("#message_record").bootstrapTable('destroy');
            $('#message_record').bootstrapTable({
                url: "/Message_Record/FindMessageByType",
                method: 'post',
                contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
                cache: false,
                queryParams:queryParams,
                striped: true,
                pagination: true,
                sortable: true,
                sortOrder: "desc",
                sortName: "mtime",
                sidePagination: 'client',
                pageSize: 10,
                pageNumber: 1,
                pageList: [10, 20, 50, 100, 200, 500],
                search: true,
                strictSearch: false,
                showColumns: true,
                showRefresh: false,
                showExport: false,
                uniqueId: "mid",
                showToggle: false,
                cardView: false,
                // clickToSelect: true,
                //  showFooter:true,
                columns:
                    [
                        // {field: "checked", checkbox: true},
                        {field: "mid", title: "消息编号", align: "center", valign: "middle", sortable: "true"},
                        {field: "type", title: "操作类型", align: "center", valign: "middle", sortable: "true",visible:false},
                        {field: "username", title: "用户名", align: "center", valign: "middle", sortable: "true"},

                        {
                            field: "behavior",
                            title: "操作",
                            align: "center",
                            valign: "middle",
                            sortable: "true",
                        },
                        {
                            field: "mtime",
                            title: "操作时间",
                            align: "center",
                            valign: "middle",
                            sortable: "true",
                        },
                    ],
                onLoadSuccess: function (data) {
                    if (data.code != null) {
                        var code = data.code;
                        var message = data.message;

                        if (code == "400") {
                            alert(message);
                            window.parent.location.href = "/login.html";
                        }
                        else if (code == "401") {
                            alert(message);
                            window.location.href = "../../error/error.html";
                        }
                    }
                }
            });
            function queryParams(params) {
                return {
                    type: type,
                }
            }
        }

    </script>
    <style>
        .alt td {
            background: black !important;
        }
    </style>
</head>
<body onload="getDate01()">
<div id="container">
    <div class="ui_content">
        <div class="ui_text_indent">
            <div id="box_border">
                <div id="box_top">消息记录</div>

                <div id="box_bottom">

                    <table id="message_record" class="table" cellspacing="0" cellpadding="0" width="100%" align="center"
                           border="0"></table>
                    <!-- <button class="btn" style="float:right;" onclick="showRegisterDiv()">新增用户</button>-->

                    <script>
                        AllInformation();
                    </script>
                </div>
            </div>

        </div>
    </div>
    <div class="ui_tb">
    </div>
    <div class="ui_content">
        <div class="ui_tb_h30">
            <div class="ui_flt" style="height: 30px; line-height: 30px;">

            </div>
            <div class="ui_frt">

            </div>
        </div>
    </div>
</div>
</body>
</html>
